package com.edu.schoolforum.enums;
/**
 * @Description
 * 异常枚举
 *
 * @Author
 * @Date
 */
public enum ResultEnum {
    SUCCESS(200, "请求成功"),
    FAIL(500, "服务器发生未知异常"),
    LOGIN_EXCEPTION(5001,"账号已被冻结"),
    INSERT_USER_FAIL(5002,"插入用户失败"),
    INSERT_POST_FAIL(5004,"发布帖子失败"),
    ACCOUNT_HAS_EXIT(5003,"账号已经存在"),
    REPLY_POST_FAIL(5005,"回复帖子失败"),
    FIND_POST_FAIL(5006,"找不到该帖子"),
    UPDATE_MESSAGE_FAIL(5007,"修改信息失败"),
    FILE_UPLOAD(5014,"文件上传失败"),
    TOKEN_EXCEPTION(5008,"token过期或token不正确"),
    TOKEN_LENGTH_EXCEPTION(5009,"token不存在"),
    INSERT_PHOTO_FAIL(5011,"插入图片失败"),
    DELETE_PHOTO_FAIL(5011,"删除图片失败"),
    EXCEPTION(6000,"未知异常，请查看后端日志"),
    INSERT_LIKE_FAIL(5015,"插入点赞信息失败"),
    LIKE_EXIST_FAIL(5016,"该点赞信息已存在"),
    LIKE_NOT_EXIT(5017,"该点赞信息不存在"),
    NO_POST_EXIST(5018,"该用户没有帖子信息"),
    DELETE_POST_FAIL(5019,"删除帖子失败"),
    UPDATE_USERSTATUS_FAIL(5020,"修改用户状态失败，可能是没有该用户或者字段错误"),
    LOGIN_ERROR(5010,"登陆异常，可能是无权访问、token不存/过期在或用户不存在");
    /**
     * 异常状态码
     */
    private int code;
    /**
     * 异常状态信息
     */
    private String msg;

    /**
     * 异常码枚举构造器
     *
     * @param msg  异常状态信息
     */
    ResultEnum(int code, String msg) {
        this.code=code;
        this.msg= msg;
    }

    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
}
